package org.csmzxy.class2333.map;
import java.util.Set;
import java.util.TreeMap;

public class Example16 {
    public static void main(String[] args){
        TreeMap<Student,String> map = new TreeMap<>();
        Student s1 = new Student("张三",89);
        Student s2 = new Student("李四",70);
        Student s3 = new Student("王五",85);
        Student s4 = new Student("赵六",89);
        map.put(s1,"A班");
        map.put(s2,"A班");
        map.put(s3,"B班");
        map.put(s4,"C班");
        Set<Student> keys = map.keySet();
        for(Student key : keys){
            String value = map.get(key);
            System.out.println(key + " 班级: " + value);
        }
    }
}
